package com.agino.jdk8.learn.classlearn;

import com.agino.jdk8.learn.utils.PrintUtils;
import com.agino.jdk8.learn.classlearn.objects.TestObjectClass;
import com.agino.jdk8.learn.classlearn.interfaces.TestInterface;

/**
 * 测试 java.lang.Class 方法
 *
 * @author qinl
 * @date 2022/4/8 8:04
 * @see Class
 **/
public class TestClassToGenericString {

    public static void main(String[] args) {

        // 测试Class 的toString()方法
        System.out.println(TestClassToGenericString.class.toString());

        PrintUtils.printCutOffRule();

        System.out.println(TestInterface.class.toString());

        PrintUtils.printCutOffRule();

        System.out.println(TestInterface[].class.toString());

        PrintUtils.printCutOffRule();


        // 测试Class 的toGenericString()方法
        System.out.println(TestInterface[].class.toGenericString());

        PrintUtils.printCutOffRule();

        TestObjectClass testClassTestObjectClass = new TestObjectClass();
        System.out.println(testClassTestObjectClass.getClass().toGenericString());

        PrintUtils.printCutOffRule();

        TestObjectClass<Integer, Object, Object> testObjectClass = new TestObjectClass<>();
        System.out.println(testObjectClass.getClass().toGenericString());
    }
}
